package cn.tedu.tmall.admin.content.pojo.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 增加分类入参
 */
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class CategoryAddParam {

    @ApiModelProperty(
            required = true,
            example = "经验",
            dataType = "String")
    @NotNull(message = "类别名称不能为空-byNull")  //不能为空 null
    @NotBlank(message = "类别名称不能为空-byBlank") //"   " ,null 也能验证 "" 也能验证
    @NotEmpty(message = "类别名称不能为空-byEmpty") // 字符串和容器
    @Size(min = 1,max = 5,message = "类别名称不能太长-BySize") //字符串和容器
    @Length(min = 1,max = 5,message = "类别名称不能太长-ByLength") //字符串
    String name;

    @ApiModelProperty(required = true)
    @Range(min = 18,max = 35,message = "年龄应在18-35岁之间")
    Integer age;


}
